<!DOCTYPE HTML>
<html>
<head>
    <!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
    <!--<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">-->
	<meta name="description" content="悦动星辰科技（深圳）有限公司是一家专业从事企业级软件开发、设计和定制，微信小程序，微信公众号开发。" />
	<meta name="keywords" content="悦动星辰,悦动星辰科技,软件开发,企业级软件,深圳企业级软件定制,小程序,微信小程序,软件定制,微信公众号" />
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
    <meta charset="UTF-8">
	<link rel="bookmark"  type="image/x-icon"  href="resources/images/yueoe-logo.png"/>
	<link rel="shortcut icon" href="resources/images/yueoe-logo.png">
    <title>悦动星辰</title>
	
	<style>
		.div{
			height: 20px;
			background-color: red;
			-webkit-animation-name: example;
			-webkit-animation-duration: 60s;
			-webkit-animation-iteration-count: 60;
			animation-name: example;
			animation-duration: 60s;
			animation-iteration-count: 60;
		}
		.center{
			height: 50px;  /* Can be anything */
			left: 50%;
			top: 50%;
			width: 100%;
			position: absolute;
			font-family: 'Microsoft YaHei', sans-serif;
			font-size: 20px;
		}
		.meter { 
		  height: 5px;  /* Can be anything */
		  left: 0;
		  top: 50%;
		  position: absolute;
		  background: #555;
		  -moz-border-radius: 5px;
		  -webkit-border-radius: 5px;
		  border-radius: 5px;
		  -webkit-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3);
		  -moz-box-shadow   : inset 0 -1px 1px rgba(255,255,255,0.3);
		  box-shadow        : inset 0 -1px 1px rgba(255,255,255,0.3);
		  }

		/* Safari 4.0 - 8.0 */
		@-webkit-keyframes example {
			0%   {background-color:#33dd33; width: 20px;}
			50%   {background-color:#dd3333; width: 50%;}
			100%  {background-color:#3333dd; width: 100%;}
		}

		/* Standard syntax */
		@keyframes example {
			0%   {background-color:#33dd33;width: 20px;}
			50%   {background-color:#dd3333; width: 50%;}
			100%  {background-color:#3333dd; width: 100%;}
		}
	</style>
	<!--必要样式-->
	<link rel="stylesheet" type="text/css" href="js/message.css"/>
	<!--<link rel="stylesheet" type="text/css" href="login/css/normalize.css"/>-->
	<link rel="icon" href="login/img/stars-logo-hs.png" type="img/x-ico"/>
	<!--<link rel="stylesheet" type="text/css" href="login/css/demo.css"/>-->
	<!--<link rel="stylesheet" type="text/css" href="login/css/component.css"/>-->

	<!--<div class='meter div' id="loadHTMLprogress2017" style="display: none"></div>-->

	<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.json2xml.js"></script>
	<script type="text/javascript" src="js/jquery.xml2json.js"></script>
	<!--<script type="text/javascript" src="js/delaunator.min.js"></script>
	<script type="text/javascript" src="js/background.js"></script>-->
	<script type="text/javascript" src="js/md5.js"></script>
	<script type="text/javascript" src="js/basic.js"></script>

	<link rel="stylesheet" type="text/css" href="resources/process/css/diagram-js.css"/>
	<link rel="stylesheet" type="text/css" href="resources/process/vendor/bpmn-font/css/bpmn-embedded.css"/>
	<link rel="stylesheet" type="text/css" href="resources/process/css/app.css"/>
	<script type="text/javascript" src="resources/process/customTranslate.js"></script>
	<script type="text/javascript" src="resources/process/translationsGerman.js"></script>
	<script type="text/javascript" src="resources/process/customer.js"></script>
	<script type="text/javascript" src="resources/process/index.js"></script>

</head>
<body>
<!--<div class="container demo-1" id="loadHTMLText2017">
	<div class="content">
		<div id="large-header" class="large-header">
			<canvas id="canvas" style="width: 100%; height: 100%;"></canvas>
			<div class="logo_box">
				<div><img src="login/img/yueoe.png" style="width:280px;position:relative;left: 20px"></div>

				<h3>流程引擎设计系统</h3>
				<form action="#" name="f" method="post">
					<div class="input_outer">
						<span class="u_user"></span>
						<input name="userName" class="text" style="color: #FFFFFF !important" type="text"
							   placeholder="请输入账户">
					</div>
					<div class="input_outer">
						<span class="us_uer"></span>
						<input name="password" class="text"
							   style="color: #FFFFFF !important; position:absolute; z-index:100;" value=""
							   type="password" placeholder="请输入密码">
					</div>
					<div class="mb2"><a class="act-but submit" href="javascript:login()" style="color: #FFFFFF">登录</a></div>
					<div style="background:transparent;position:relative;bottom: -60px;left:20px;">
						<span id="footer_0_tCopyRight">©2019 悦动星辰科技（深圳）有限公司 <br> 粤ICP备19152575</span>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>-->
<script type="text/javascript">
    var Authorization = localStorage.getItem('Authorization');
    if(Authorization){
        setTimeout(function () {
            Ext.Microloader.run();
        },50);
        //$("#loadHTMLText2017").attr("style","display:none;");
    }else{
        if (!!window.ActiveXObject || "ActiveXObject" in window){

        }else{
            var canvas = document.getElementById('canvas');
            if(canvas){
				canvas.height = window.innerHeight;
				var spaceboi = new Thpace(canvas);
				spaceboi.start();
			}
        }
    }
    $("input[ name='userName']").bind('keyup',function(event){
        if(event.keyCode == "13")
        {
            login();
        }
    });
    $("input[ name='password']").bind('keyup',function(event){
        if(event.keyCode == "13")
        {
            login();
        }
    });

    setTimeout(function () {
        localStorage.setItem("Authorization", "test-001");
        localStorage.setItem("currentUser", JSON.stringify({name:'admin'}));
        document.cookie = "userId=admin";
        Ext.Microloader.run();
//        $("#loadHTMLText2017").attr("style","display:none;");
//        $("#loadHTMLprogress2017").attr("style","display:'inline';");
    },500);

    function login() {
        //1.先拿到帐号和密码
        var data = {
            userName: $("input[ name='userName']").val(),
            password: $("input[ name='password']").val()
        };
        var myRoot = {};
        if (!data.userName || !data.password || !data.userName.trim()) {
            var emptyfields = $(".input_outer");
            if (emptyfields.size() > 0) {
                emptyfields.each(function() {
                    $(this).stop()
                        .animate({ left: "-10px" }, 100).animate({ left: "10px" }, 100)
                        .animate({ left: "-10px" }, 100).animate({ left: "10px" }, 100)
                        .animate({ left: "0px" }, 100);
                });
            }
            return;
        }
        $.ajax({
            //请求方式
            type : "POST",
            //请求的媒体类型
            dataType: "json",
            //请求地址
            url : "api/auth/token",
            //数据，json字符串
            data : {
                username: data.userName.trim(),
                password: hex_md5(data.password)
            },
            //请求成功
            success : function(obj) {
                if(obj.hasErrors){
                    $.message({
                        message:obj.errorMessage,
                        type:'error'
                    });
                    return;
                }
                localStorage.setItem("Authorization", obj.data.token);
                localStorage.setItem("currentUser", JSON.stringify(obj.data.user));
                document.cookie = "userId="+obj.data.user.id;
                Ext.Microloader.run();
                $("#loadHTMLText2017").attr("style","display:none;");
                $("#loadHTMLprogress2017").attr("style","display:'inline';");
            },
            //请求失败，包含具体的错误信息
            error : function(e){
                console.log(e.status);
                console.log(e.responseText);
            }
        });
    }
</script>

<!--<script type="text/javascript" src="js/jquery.jqprint-0.3.js"></script>-->
<!--<script type="text/javascript" src="js/jquery-migrate-1.2.1.min.js"></script>-->
<!--<script type="text/javascript" src="js/echarts.min.js"></script>-->
<!--<script type="text/javascript" src="js/macarons.js"></script>-->
<script type="text/javascript" src="js/message.js"></script>


<script type="text/javascript">
    var Ext = Ext || {}; // Ext namespace won't be defined yet...

    Ext.beforeLoad = function (tags) {
        var s = location.search,  // the query string (ex "?foo=1&bar")
            profile = 'classic';

        Ext.manifest = profile; // this name must match a build profile name

    };
</script>

<!-- The line below must be kept intact for Sencha Cmd to build your application -->
<script id="microloader" type="text/javascript" src="bootstrap-stars.js"></script>
</body>
</html>
